<form name="form1">
<table id="fx" width="100%">
	{if ($AppUI->admin_group_id==$smarty.const.GROUP_Administrator)}
			<thead>
					<tr>
						{foreach from=$arrAdminstrator item=title}
								<th 
									{foreach from = $arrTooltip item = tooltip}
										{if $tooltip.column ==$title}
										  title ="{$tooltip.description}"
										{/if}
									{/foreach}
								>
								    {if $title|in_array:$arrCheckBox}	
									   {$arrColumnTitle[$title]}
									{else}
										{$arrColumnTitle[$title]} 
										{if $title==$strOrderField}
											{if $strOrderValue=='asc'} <img src="img/arrow_up.png" />
												{else}<img src="img/arrow_down.png" />
											{/if}
										{/if}
									{/if}
								</th>
						{/foreach}
					</tr>
				</thead>
				{assign var='c' value=0}
				{foreach from=$arrResult item=result}
					<tr {if ($c % 2 == 1) } class="bg" {/if}>
					    {assign var='c' value=$c+1}
						{foreach from=$arrAdminstrator item=title}
							<td  {if !($title|in_array:$arrAlignLeft)}	
										 align='center'
								{/if}

								{if ($title=='sku')}	
									{if ($result.marketing_check==0 && $result.buying_check==0) }
										class="feedback-pending"
									{elseif ($result.marketing_check==0)}
										class="marketing-feedback-pending"
									{elseif ($result.buying_check==0)}
										class="buying-feedback-pending"
									{elseif ($result.marketing_check==1 && $result.buying_check==1) }
										class="feedback-complete"
									{/if}
								{/if}
							>
							{if $title|in_array:$_arrNoModify}	
									{if $title=='_bucket'}
										{$result[$title]|dragon_column_name}
									{elseif $title=='sku'}
										<a href="javascript:void(0)" onclick="SkuCommon.pop_up('{$result[$title]}', '{$result.category}')">{$result[$title]}
										{include file="forecast/index.popup.image.tpl"}
										</a>
									{elseif ($title=='exponential_smoothening' || $title=='moving_average'
										|| $title=='tsl' || $title=='msl')}
									{if $result[$title] < 0 }
										0
									{else}
										{$result[$title]}
									{/if}
									{else}
										{$result[$title]}
									{/if}
							{elseif $title|in_array:$arrCheckBox}		
							 	<input type="checkbox" disabled="true"
								  {if $result[$title]==1}
										checked="checked"
								  {/if} class="{$title}_class"
								  size="4" id="{$title}_{$result.id}"
									onchange="update_field_checkbox('{$result.id}', '{$title}')" />
								<span id="w_{$title}_{$result.id}"></span>
							{else}
								{$result[$title]} 
								<span id="w_{$title}_{$result.id}"></span>
							{/if}
							</td>	
						 {/foreach}	
					</tr>
				{/foreach}	

	{elseif ($AppUI->admin_group_id==$smarty.const.GROUP_Marketing)}
			<thead>
					<tr>
						{foreach from=$arrMarketing item=title}
								<th
									{foreach from = $arrTooltip item = tooltip}
										{if $tooltip.column ==$title}
										  title ="{$tooltip.description}"
										{/if}
									{/foreach}
								>
								    {if $title|in_array:$arrCheckBox}	
									   {$arrColumnTitle[$title]} 
									{else}
										{$arrColumnTitle[$title]} 
										{if $title==$strOrderField}
											{if $strOrderValue=='asc'} <img src="img/arrow_up.png" />
												{else}<img src="img/arrow_down.png" />
											{/if}
										{/if}
									{/if}
								</th>
						{/foreach}
					</tr>
				</thead>
				{assign var='c' value=0}
				{foreach from=$arrResult item=result}
					<tr {if ($c % 2 == 1) } class="bg" {/if}>
					    {assign var='c' value=$c+1}
						{foreach from=$arrMarketing item=title}
							<td {if !($title|in_array:$arrAlignLeft)}	
										 align='center'
								{/if}

								{if ($title=='sku')}	
									{if ($result.marketing_check==0 && $result.buying_check==0) }
										class="feedback-pending"
									{elseif ($result.marketing_check==0)}
										class="marketing-feedback-pending"
									{elseif ($result.buying_check==0)}
										class="buying-feedback-pending"
									{elseif ($result.marketing_check==1 && $result.buying_check==1) }
										class="feedback-complete"
									{/if}
								{/if}
								>
							{if $title|in_array:$_arrNoModify}	
									{if $title=='_bucket'}
										{$result[$title]|dragon_column_name}
									{elseif $title=='sku'}
										<a href="javascript:void(0)" onclick="SkuCommon.pop_up('{$result[$title]}', '{$result.category}')">{$result[$title]}
										{include file="forecast/index.popup.image.tpl"}
										</a>
									{elseif ($title=='exponential_smoothening' || $title=='moving_average'
										|| $title=='tsl' || $title=='msl')}
									{if $result[$title] < 0 }
										0
									{else}
										{$result[$title]}
									{/if}
									{else}
										{$result[$title]}
									{/if}
							{elseif $title|in_array:$arrCheckBox}		
							 	<input type="checkbox" disabled="true"
								  {if $result[$title]==1}
										checked="checked"
								  {/if} class="{$title}_class"
								  size="4" id="{$title}_{$result.id}"
									onchange="update_field_checkbox('{$result.id}', '{$title}')" />
								<span id="w_{$title}_{$result.id}"></span>
							{else}
								{$result[$title]} 
								<span id="w_{$title}_{$result.id}"></span>
							{/if}
							</td>	
						 {/foreach}	
					</tr>
				{/foreach}	
	{elseif ($AppUI->admin_group_id==$smarty.const.GROUP_Buying)}
		<thead>
					<tr>
						{foreach from=$arrBuying item=title}
								<th 
									{foreach from = $arrTooltip item = tooltip}
										{if $tooltip.column ==$title}
										  title ="{$tooltip.description}"
										{/if}
									{/foreach}
								>
								    {if $title|in_array:$arrCheckBox}	
									   {$arrColumnTitle[$title]}
									{else}
										{$arrColumnTitle[$title]} 
										{if $title==$strOrderField}
											{if $strOrderValue=='asc'} <img src="img/arrow_up.png" />
												{else}<img src="img/arrow_down.png" />
											{/if}
										{/if}
									{/if}
								</th>
						{/foreach}
					</tr>
				</thead>
				{assign var='c' value=0}
				{foreach from=$arrResult item=result}
					<tr {if ($c % 2 == 1) } class="bg" {/if}>
					    {assign var='c' value=$c+1}
						{foreach from=$arrBuying item=title}
							<td	 {if !($title|in_array:$arrAlignLeft)}	
										 align='center'
								{/if}

								{if ($title=='sku')}	
									{if ($result.marketing_check==0 && $result.buying_check==0) }
										class="feedback-pending"
									{elseif ($result.marketing_check==0)}
										class="marketing-feedback-pending"
									{elseif ($result.buying_check==0)}
										class="buying-feedback-pending"
									{elseif ($result.marketing_check==1 && $result.buying_check==1) }
										class="feedback-complete"
									{/if}
								{/if}
							>
							{if $title|in_array:$_arrNoModify}	
									{if $title=='_bucket'}
										{$result[$title]|dragon_column_name}
									{elseif $title=='sku'}
									<a href="javascript:void(0)" onclick="SkuCommon.pop_up('{$result[$title]}', '{$result.category}')">{$result[$title]}
										{include file="forecast/index.popup.image.tpl"}
									</a>
									{elseif ($title=='exponential_smoothening' || $title=='moving_average'
										|| $title=='tsl' || $title=='msl')}
									{if $result[$title] < 0 }
										0
									{else}
										{$result[$title]}
									{/if}
									{else}
										{$result[$title]}
									{/if}
							{elseif $title|in_array:$arrCheckBox}		
							 	<input type="checkbox" disabled="true"
								  {if $result[$title]==1}
										checked="checked"
								  {/if} class="{$title}_class"
								  size="4" id="{$title}_{$result.id}"
									onchange="update_field_checkbox('{$result.id}', '{$title}')" />
								<span id="w_{$title}_{$result.id}"></span>
							{else}
								{$result[$title]} 
								<span id="w_{$title}_{$result.id}"></span>
							{/if}
							</td>	
						 {/foreach}	
					</tr>
				{/foreach}	
	{elseif ($AppUI->admin_group_id==$smarty.const.GROUP_Inventory)}
				<thead>
					<tr>
						{foreach from=$arrInventory item=title}
								<th 
									{foreach from = $arrTooltip item = tooltip}
										{if $tooltip.column ==$title}
										  title ="{$tooltip.description}"
										{/if}
									{/foreach}
								>
								    {if $title|in_array:$arrCheckBox}	
									   {$arrColumnTitle[$title]} 
									{else}
										{$arrColumnTitle[$title]} 
										{if $title==$strOrderField}
											{if $strOrderValue=='asc'} <img src="img/arrow_up.png" />
												{else}<img src="img/arrow_down.png" />
											{/if}
										{/if}
									{/if}
								</th>
						{/foreach}
					</tr>
				</thead>
				{assign var='c' value=0}
				{foreach from=$arrResult item=result}
					<tr {if ($c % 2 == 1) } class="bg" {/if}>
					    {assign var='c' value=$c+1}
						{foreach from=$arrInventory item=title}
							<td 
								 {if !($title|in_array:$arrAlignLeft)}	
										 align='center'
								{/if}

								{if ($title=='sku')}	
									{if ($result.marketing_check==0 && $result.buying_check==0) }
										class="feedback-pending"
									{elseif ($result.marketing_check==0)}
										class="marketing-feedback-pending"
									{elseif ($result.buying_check==0)}
										class="buying-feedback-pending"
									{elseif ($result.marketing_check==1 && $result.buying_check==1) }
										class="feedback-complete"
									{/if}
								{/if}
							>
							{if $title|in_array:$_arrNoModify}	
									{if $title=='_bucket'}
										{$result[$title]|dragon_column_name}
									{elseif $title=='sku'}
										<a href="javascript:void(0)" onclick="SkuCommon.pop_up('{$result[$title]}', '{$result.category}')">{$result[$title]}
										{include file="forecast/index.popup.image.tpl"}
										</a>
									{elseif ($title=='exponential_smoothening' || $title=='moving_average'
										|| $title=='tsl' || $title=='msl')}
									{if $result[$title] < 0 }
										0
									{else}
										{$result[$title]}
									{/if}
									{else}
										{$result[$title]}
									{/if}
							{elseif $title|in_array:$arrCheckBox}		
							 	<input type="checkbox" disabled="true"
								  {if $result[$title]==1}
										checked="checked"
								  {/if} class="{$title}_class"
								  size="4" id="{$title}_{$result.id}"
									onchange="update_field_checkbox('{$result.id}', '{$title}')" />
								<span id="w_{$title}_{$result.id}"></span>
							{else}
								{$result[$title]} 
								<span id="w_{$title}_{$result.id}"></span>
							{/if}
							</td>	
						 {/foreach}	
					</tr>
				{/foreach}	
	{/if}
</table>
</form>